package com.flyme.module.base.provider.service.impl;

import com.flyme.common.core.model.query.CriteriaQuery;
import com.flyme.common.core.model.query.PagerInfo;
import com.flyme.core.base.supper.entity.EntityMap;
import com.flyme.core.base.supper.service.impl.BaseServiceImpl;
import com.flyme.module.base.client.entity.SysPeriodrecord;
import com.flyme.module.base.provider.mapper.SysPeriodrecordMapper;
import com.flyme.module.base.provider.service.SysPeriodrecordService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysPeriodrecordServiceImpl extends BaseServiceImpl<SysPeriodrecordMapper, SysPeriodrecord> implements SysPeriodrecordService {

    @Override
    public List<EntityMap> getPeriodrecord(Long userId, Long courseId, Long usercertificateId, String startTime, String endTime) {
        PagerInfo  info=new PagerInfo();
        CriteriaQuery queryWrapper = new CriteriaQuery<EntityMap>(info);
        queryWrapper.addSql("*");
        queryWrapper.eq("p.courseId",courseId);
        queryWrapper.eq("p.usercertificateId",usercertificateId);
        queryWrapper.eq("p.userId",userId);
        queryWrapper.between("p.createTime",startTime,endTime);
        return pageList(queryWrapper).getRows();
    }

}
